require(['./config'], () => {
    require(['template', 'request', 'header','footer','carousel', 'right_border'], (template, request) => {
        class Index{
            constructor() {
                this.adverrender()
                this.thr_adverrender()
                // this.right_nav()
            }


            //渲染下部8个广告
            adverrender() {
                request.adverrender().then(resp => {
                    if(resp.code === 200) {
                        const { list } = resp.body
                        $('#ul_adverList').html(template('adverlistrender', { list }))
                    }
                })
            }

            //渲染中部三个广告
            thr_adverrender() {
                request.thr_adver().then(resp => {
                    if(resp.code === 200) {
                        const { list } = resp.body
                        $('#thr_adver').html(template('thr_adverrender', { list }))
                    }
                })
            }

            // //渲染右侧固定导航栏myself图片
            // right_nav() {
            //     request.adverrender().then(resp => {
            //         if(resp.code === 200) {
            //             let { list } = resp.body
            //              console.log({list}.slice(0, 6))
            //             // $('.right-zuji-list').html(template('right-zuji-image', { list }))
            //         }
            //     })
            // }
        }
        new Index()
    })
})
